﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//
using PerceptiveMCAPI;
using PerceptiveMCAPI.Types;
using System.Data;
//
namespace PerceptiveMCAPI_Test
{
   public partial class show_listStaticSegmentMembers : System.Web.UI.UserControl
   {
      public void Display( listStaticSegmentAddMembersOutput output )
      {
         this.Visible = true;

         lblCounts.Text = string.Format( "Success count: {0}, Error count: {1}",
            output.result.success, output.result.errors.Count );
         if ( output.result.errors.Count > 0 )
         {
            // manual format
            gvErrors.DataSource = output.result.errors;
            gvErrors.DataBind();
         }
         else
         {
            gvErrors.DataSource = "";
            gvErrors.DataBind();
         }
      }
      // --
      public void Display( listStaticSegmentDelMembersOutput output )
      {
         this.Visible = true;

         lblCounts.Text = string.Format( "Success count: {0}, Error count: {1}",
            output.result.success, output.result.errors.Count );
         if ( output.result.errors.Count > 0 )
         {
            gvErrors.DataSource = output.result.errors;
            gvErrors.DataBind();
         }
         else
         {
            gvErrors.DataSource = "";
            gvErrors.DataBind();
         }
      }
   }
}